unit uDMAdresy;

interface

uses
  SysUtils, Classes, uADStanIntf, uADStanOption, uADStanError, uADGUIxIntf, uADPhysIntf,
  uADStanDef, uADStanPool, uADPhysManager, DB, uADCompClient, uADStanParam, uADDatSManager,
  uADDAptIntf, uADStanAsync, uADDAptManager, uADCompDataSet;

type
  TDMAdresy = class(TDataModule)
    ADQWojewodztwa: TADQuery;
    ADQAdres: TADQuery;
    ADQidWojewodztwa: TADQuery;
    ADQPowiaty: TADQuery;
    ADQidPowiatu: TADQuery;
    ADQGminy: TADQuery;
    ADQidGminy: TADQuery;
    ADQMiasta: TADQuery;
    ADQidMiejscowosciWGminach: TADQuery;
    ADQNazwyUlic: TADQuery;
    ADQNumerWMiescie: TADQuery;
    ADQUlice: TADQuery;
    ADQidNazwaUlica: TADQuery;
    ADQAdresMiasto: TADQuery;
    ADQAdresPoprzedni: TADQuery;
    ADQAdresyXML: TADQuery;
    ADQAdresXMLPoprzedni: TADQuery;
    ADQZmienAdres: TADQuery;
    ADQZmienAdresMiasto: TADQuery;
    ADQidUlicy: TADQuery;
    ADQidNumerWMiescie: TADQuery;
    ADQZmianaAdresXML: TADQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
    ADConnection: TADConnection;
    ADTransaction: TADTransaction;
  public
    { Public declarations }
    constructor Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
  end;

//var
//  DMAdresy: TDMAdresy;

implementation

{$R *.dfm}

constructor TDMAdresy.Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
begin
  inherited Create(AOwner);
  ADConnection := Connection;
  ADTransaction := Transaction;
  Name := '';
end;

procedure TDMAdresy.DataModuleCreate(Sender: TObject);
var
  i : integer;
begin
  for i:=0 to Self.ComponentCount-1 do
  begin
    if Self.Components[i] is TADQuery then
    begin
      (Self.Components[i] as TADQuery).Connection := ADConnection;
      (Self.Components[i] as TADQuery).Transaction  := ADTransaction;
    end;
  end;
end;

end.
